// --------------------------------------------------------------------------------------------
// Version: MPL 1.1/GPL 2.0/LGPL 2.1
// 
// The contents of this file are subject to the Mozilla Public License Version
// 1.1 (the "License"); you may not use this file except in compliance with
// the License. You may obtain a copy of the License at
// http://www.mozilla.org/MPL/
// 
// Software distributed under the License is distributed on an "AS IS" basis,
// WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License
// for the specific language governing rights and limitations under the
// License.
// 
// <remarks>
// Generated by IDLImporter from file nsIProcess.idl
// 
// You should use these interfaces when you access the COM objects defined in the mentioned
// IDL/IDH file.
// </remarks>
// --------------------------------------------------------------------------------------------
namespace Gecko
{
	using System;
	using System.Runtime.InteropServices;
	using System.Runtime.InteropServices.ComTypes;
	using System.Runtime.CompilerServices;
	
	
	/// <summary>
    ///This Source Code Form is subject to the terms of the Mozilla Public
    /// License, v. 2.0. If a copy of the MPL was not distributed with this
    /// file, You can obtain one at http://mozilla.org/MPL/2.0/. </summary>
	[ComImport()]
	[InterfaceType(ComInterfaceType.InterfaceIsIUnknown)]
	[Guid("609610de-9954-4a63-8a7c-346350a86403")]
	public interface nsIProcess
	{
		
		/// <summary>
        /// Initialises the process with an executable to be run. Call the run method
        /// to run the executable.
        /// @param executable The executable to run.
        /// </summary>
		[MethodImpl(MethodImplOptions.InternalCall, MethodCodeType=MethodCodeType.Runtime)]
		void Init([MarshalAs(UnmanagedType.Interface)] nsIFile executable);
		
		/// <summary>
        /// Kills the running process. After exiting the process will either have
        /// been killed or a failure will have been returned.
        /// </summary>
		[MethodImpl(MethodImplOptions.InternalCall, MethodCodeType=MethodCodeType.Runtime)]
		void Kill();
		
		/// <summary>
        /// Executes the file this object was initialized with
        /// @param blocking   Whether to wait until the process terminates before
        ///                       returning or not.
        /// @param args       An array of arguments to pass to the process in the
        /// native character set.
        /// @param count      The length of the args array.
        /// </summary>
		[MethodImpl(MethodImplOptions.InternalCall, MethodCodeType=MethodCodeType.Runtime)]
		void Run([MarshalAs(UnmanagedType.U1)] bool blocking, [MarshalAs(UnmanagedType.LPArray, SizeParamIndex=2)] string[] args, uint count);
		
		/// <summary>
        /// Executes the file this object was initialized with optionally calling
        /// an observer after the process has finished running.
        /// @param args       An array of arguments to pass to the process in the
        /// native character set.
        /// @param count      The length of the args array.
        /// @param observer   An observer to notify when the process has completed. It
        /// will receive this process instance as the subject and
        /// "process-finished" or "process-failed" as the topic. The
        /// observer will be notified on the main thread.
        /// @param holdWeak   Whether to use a weak reference to hold the observer.
        /// </summary>
		[MethodImpl(MethodImplOptions.InternalCall, MethodCodeType=MethodCodeType.Runtime)]
		void RunAsync([MarshalAs(UnmanagedType.LPArray, SizeParamIndex=1)] string[] args, uint count, [MarshalAs(UnmanagedType.Interface)] nsIObserver observer, [MarshalAs(UnmanagedType.U1)] bool holdWeak);
		
		/// <summary>
        /// Executes the file this object was initialized with
        /// @param blocking   Whether to wait until the process terminates before
        ///                       returning or not.
        /// @param args       An array of arguments to pass to the process in UTF-16
        /// @param count      The length of the args array.
        /// </summary>
		[MethodImpl(MethodImplOptions.InternalCall, MethodCodeType=MethodCodeType.Runtime)]
		void Runw([MarshalAs(UnmanagedType.U1)] bool blocking, [MarshalAs(UnmanagedType.LPArray, SizeParamIndex=2)] System.IntPtr[] args, uint count);
		
		/// <summary>
        /// Executes the file this object was initialized with optionally calling
        /// an observer after the process has finished running.
        /// @param args       An array of arguments to pass to the process in UTF-16
        /// @param count      The length of the args array.
        /// @param observer   An observer to notify when the process has completed. It
        /// will receive this process instance as the subject and
        /// "process-finished" or "process-failed" as the topic. The
        /// observer will be notified on the main thread.
        /// @param holdWeak   Whether to use a weak reference to hold the observer.
        /// </summary>
		[MethodImpl(MethodImplOptions.InternalCall, MethodCodeType=MethodCodeType.Runtime)]
		void RunwAsync([MarshalAs(UnmanagedType.LPArray, SizeParamIndex=1)] System.IntPtr[] args, uint count, [MarshalAs(UnmanagedType.Interface)] nsIObserver observer, [MarshalAs(UnmanagedType.U1)] bool holdWeak);
		
		/// <summary>
        /// The process identifier of the currently running process. This will only
        /// be available after the process has started and may not be available on
        /// some platforms.
        /// </summary>
		[MethodImpl(MethodImplOptions.InternalCall, MethodCodeType=MethodCodeType.Runtime)]
		uint GetPidAttribute();
		
		/// <summary>
        /// The exit value of the process. This is only valid after the process has
        /// exited.
        /// </summary>
		[MethodImpl(MethodImplOptions.InternalCall, MethodCodeType=MethodCodeType.Runtime)]
		int GetExitValueAttribute();
		
		/// <summary>
        /// Returns whether the process is currently running or not.
        /// </summary>
		[return: MarshalAs(UnmanagedType.U1)]
		[MethodImpl(MethodImplOptions.InternalCall, MethodCodeType=MethodCodeType.Runtime)]
		bool GetIsRunningAttribute();
	}
}
